<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Name:  Students Model
*
* Author:  Ervin R. Musngi
*
*/

class Section_m extends DataMapperExt
{
	var $table = 'sections';
	var $has_many	= array(
							'student' => array(
								'class'			=> 'student_m',
								'other_field'	=> 'section',
								'join_self_as' 	=> 'section_listing',
								'join_other_as' => 'student',
								'join_table'	=> 'student_listings'
							),
							'school_years'	=>	array(
									'class'			=> 'school_year_m',
									'other_field'	=> 'sections',
									'join_self_as' 	=> 'section',
									'join_other_as' => 'school_year',
									'join_table'	=> 'section_listings'
							),
							'school_levels'	=>	array(
									'class'			=> 'school_level_m',
									'other_field'	=> 'sections',
									'join_self_as' 	=> 'section',
									'join_other_as' => 'school_level',
									'join_table'	=> 'section_listings'
							),
							'section_listings'	=> array(
									'class'			=> 'section_listing_m',
									'other_field'	=> 'sections',
									'join_self_as'	=> 'section',
									'join_table'	=> 'section_listing'
							)
					);
	var $has_one	= array(
						'school_level'	=>	array(
								'class'			=> 'school_level_m',
								'other_field'	=> 'section_lists',
								'join_self_as' 	=> 'section',
								'join_other_as' => 'school_level',
								'join_table'	=> 'sections'
						)
					);
	
	public function __construct($id = NULL)
	{
		parent::__construct($id);
	}
}